package com.demo.cloud.security.gateway.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry){

        // 登录请求，跳转到uaa服务的login页面
        registry.addViewController("/login").setViewName("redirect:/uaa/login");
        registry.addViewController("/oauth/authorize").setViewName("redirect:/uaa/oauth/authorize");
        registry.addViewController("/oauth/token").setViewName("redirect:/uaa/oauth/token");
    }
}
